// 高德地图懒加载
export default function MapLoader() {
  return new Promise((resolve, reject) => {
    if (window.AMap) {
      resolve(window.AMap);
    } else {
      let script = document.createElement("script");
      script.type = "text/javascript";
      script.async = true;
      script.src = "http://webapi.amap.com/maps?v=1.4.15&callback=onAMapLoaded&key=f71aa620a3d4a93b69de8e090954085b&plugin=AMap.ControlBar";
      script.onerror = reject;
      document.head.appendChild(script);
    }
    window.onAMapLoaded = () => {
      resolve(window.AMap);
    };
  });
}
// 高德地图ui懒加载

// 高德地图相关视图插件懒加载